package com.ruoyi.system.mapper;

import java.util.List;
import com.ruoyi.system.domain.FyInfo;
import com.ruoyi.system.domain.vo.web.WebFyInfoVo;
import org.apache.ibatis.annotations.Select;

/**
 * 资讯Mapper接口
 *
 * @author ruoyi
 * @date 2025-06-05
 */
public interface FyInfoMapper
{
    /**
     * 查询资讯
     *
     * @param infoId 资讯主键
     * @return 资讯
     */
    public FyInfo selectFyInfoByInfoId(Long infoId);

    /**
     * 查询资讯列表
     *
     * @param fyInfo 资讯
     * @return 资讯集合
     */
    public List<FyInfo> selectFyInfoList(FyInfo fyInfo);

    @Select("<script> select info_id as infoId,\n" +
            "info_title as infoTitle,\n" +
            "info_img as infoImg,\n" +
            "source as source,\n" +
            "brief as brief,\n" +
            "pub_time as pubTime,\n" +
            "content as content  from fy_info\n" +
            "<where>\n" +
            "            <if test=\"infoTitle != null  and infoTitle != ''\"> and info_title like concat('%', #{infoTitle}, '%')</if>\n" +
            "            and is_delete = 0\n" +
            "        </where> </script>")
    public List<WebFyInfoVo> selectWebInfoList(String infoTitle);
    /**
     * 新增资讯
     *
     * @param fyInfo 资讯
     * @return 结果
     */
    public int insertFyInfo(FyInfo fyInfo);

    /**
     * 修改资讯
     *
     * @param fyInfo 资讯
     * @return 结果
     */
    public int updateFyInfo(FyInfo fyInfo);

    /**
     * 删除资讯
     *
     * @param infoId 资讯主键
     * @return 结果
     */
    public int deleteFyInfoByInfoId(Long infoId);

    /**
     * 批量删除资讯
     *
     * @param infoIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteFyInfoByInfoIds(Long[] infoIds);
}
